<%--
  Created by IntelliJ IDEA.
  User: pinecone
  Date: 2024/9/23
  Time: 20:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        table {
            margin: 0 auto;
            border: 1px solid green;
            width: 50%;
        }

        table td {
            border: 1px solid blue;
        }
    </style>
</head>
<body>
<!--http://localhost:8080/servlet_jsp01_Web_exploded/test01.jsp?rows=15&cols=8-->
<%
    int row = Integer.parseInt(request.getParameter("rows"));
    int col = Integer.parseInt(request.getParameter("cols"));
    StringBuilder sb = new StringBuilder();
    sb.append("<table>");
    for (int i = 1; i <= row; i++) {
        sb.append("<tr>");
        for (int j = 1; j <= col; j++) {
            sb.append("<td>");
            sb.append(String.valueOf(i));
            sb.append(String.valueOf(j));
            sb.append("</td>");
        }
        sb.append("</tr>");
    }
    sb.append("</table>");
    out.print(sb.toString());
%>
</body>
</html>
